package gui;


import javax.swing.JComponent;
import javax.swing.JFrame;

import conference.Review;
import conference.User;

import java.util.List;
import java.util.ArrayList;


public class SmartPeerReviewStartup {

	private static List<conference.Conference> my_conferences;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		GuiController gc = new GuiController();
		gc.toString(); // hack for warning to go away. Delete later.
		/*
		JFrame myFrame = new JFrame("Choose Conference...");
		
		ChooseConferencePanel ccg = new ChooseConferencePanel();
		//ChooseUserGUI cug = new ChooseUserGUI();
		//ChooseRolePanel crg = new ChooseRolePanel();
		//AuthorSubmitManuscriptGUI asm = new AuthorSubmitManuscriptGUI();
		
		/*		
		myFrame.add(crg);
		myFrame.pack();
		myFrame.setLocationRelativeTo(null);
		myFrame.setVisible(true);

		myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);*/
		
		//Load data from XML
	//	my_conferences = ConsumeXMLData.extractConferences("conferences.xml", false);
				
		//ChooseUserGUI cug = new ChooseUserGUI();
		//ChooseRoleGUI crg = new ChooseRoleGUI();		
		//ViewManuscriptGui vmg = new ViewManuscriptGui();
		//*/
		
		/*
		JFrame frame = new JFrame();
		frame.getContentPane().add(vmg);
		frame.pack();
		frame.setBounds(frame.getBounds().x,
				frame.getBounds().y,
				frame.getBounds().width + 25,
				(int)(frame.getBounds().height / 1.5f));
		frame.validate();
		*/
	}
	
	private static List<String> getConferenceTitles(){
		ArrayList<String> listOfConferences = new ArrayList<String>();
		for (int i=0; i < my_conferences.size(); i++){
			listOfConferences.add(my_conferences.get(i).getTitle());
		}
		return listOfConferences;
	}
	
	private static List<User> getUsers(){
		ArrayList<User> listOfUsers = new ArrayList<User>();
		for (int i=0; i < my_conferences.size(); i++){
			conference.Manuscript[] allManuscripts = my_conferences.get(i).getAllManuscripts();
			for (int j=0; j < allManuscripts.length; j++){
				listOfUsers.add(allManuscripts[j].getAuthor());
				List<Review> reviews = allManuscripts[j].getReviews();
				for (int k=0; k < reviews.size(); k++){
					listOfUsers.add(reviews.get(k).getReviewer());
				}
			}
		}
		return listOfUsers;
	}

}
